package com.fypg.module.blooddonation.api.client.enums;

import static com.fypg.framework.common.exception.util.ServiceExceptionUtil.exception;

public enum StationPath {

    FS("02013", "/FSHealth/RestService.asmx/MBS_FoShanHealthPlatform/Api"),
    SS("02032", "/SSHealth/RestService.asmx/MBS_FoShanHealthPlatform/Api"),
    GM("02030", "/GMHealth/RestService.asmx/MBS_FoShanHealthPlatform/Api"),
    SD("02015", "/SDHealth/RestService.asmx/MBS_FoShanHealthPlatform/Api"),
    NH("02014", "/NHHealth/RestService.asmx/MBS_FoShanHealthPlatform/Api");

    private final String orgId;
    private final String path;

    StationPath(String orgId, String path) {
        this.orgId = orgId;
        this.path = path;
    }

    public String getOrgId() {
        return orgId;
    }

    public String getPath() {
        return path;
    }

    // ✅ 根据 orgId 获取对应枚举
    public static String fromOrgId(String orgId) {
        for (StationPath p : values()) {
            if (p.orgId.equals(orgId)) {
                return p.getPath();
            }
        }
        throw exception(ErrorCodeConstants.INVALID_ENCODING);
    }
}
